import request from '@/utils/request'

export function getDepartmentList () {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

export function getManagerList () {
  return request({
    url: '/sys/user/simple',
    method: 'GET'
  })
}

export function addDepartment (data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 获取单个部门详情

export function getDepartmentDetail (id) {
  return request({
    url: '/company/department/' + id,
    method: 'GET'
  })
}

// 更新部门详情

export function updateDepartment (data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}

// 删除部门

export function delDepartment (id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}
